<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>mapDemo</title>
<script src="https://js.arcgis.com/4.10/"></script>
</head>
<body>
<h2>加载WMTS</h2>
<div id="mapViewDiv" style="height:600px;width:100%"></div>
<script>
	
	var layerUrl = "替换服务调用地址";

	require(["esri/layers/WebTileLayer",
		"esri/geometry/SpatialReference",
		"esri/layers/support/TileInfo"], function(WebTileLayer,SpatialReference,TileInfo) {
		var spatialReference = new SpatialReference({
			"wkt": 'PROJCS["CGCS2000 3 Degree GK CM 113E",GEOGCS["GCS_China_Geodetic_Coordinate_System_2000",DATUM["D_China_2000",SPHEROID["CGCS2000",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",700000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",113.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]'
		});
		var tileInfo = new TileInfo({
			dpi: 96,
			rows: 256,
			cols: 256,
			compressionQuality: 0,
			origin: {
				x: -4923200.0,
				y: 10002100
			},
			spatialReference:spatialReference,
			lods: [
				{ level: 0, resolution: 156543.34701231902, scale: 5.916587109E8 },
				{ level: 1, resolution: 78271.67350615951, scale: 2.9582935545E8 },
				{ level: 2, resolution: 39135.83675440268, scale: 1.4791467773E8 },
				{ level: 3, resolution: 19567.91837587842, scale: 7.395733886E7 },
				{ level: 4, resolution: 9783.95918793921, scale: 3.697866943E7 },
				{ level: 5, resolution: 4891.979595292524, scale: 1.848933472E7 },
				{ level: 6, resolution: 2445.989797646262, scale: 9244667.36 },
				{ level: 7, resolution: 1222.994898823131, scale: 4622333.68 },
				{ level: 8, resolution: 611.4974494115655, scale: 2311166.84 },
				{ level: 9, resolution: 305.74872470578276, scale: 1155583.42 },
				{ level: 10, resolution: 152.87436235289138, scale: 577791.71 },
				{ level: 11, resolution: 76.43717985352637, scale: 288895.85 },
				{ level: 12, resolution: 38.2185912496825, scale: 144447.93 },
				{ level: 13, resolution: 19.10929430192194, scale: 72223.96 },
				{ level: 14, resolution: 9.55464715096097, scale: 36111.98 },
				{ level: 15, resolution: 4.777323575480485, scale: 18055.99 },
				{ level: 16, resolution: 2.3886631106595546, scale: 9028 },
				{ level: 17, resolution: 1.1943315553297773, scale: 4514 },
				{ level: 18, resolution: 0.5971657776648887, scale: 2257 },
				{ level: 19, resolution: 0.2985828888324443, scale: 1128.5 },
				{ level: 20, resolution: 0.14929144441622216, scale: 564.25 },
				{ level: 21, resolution: 0.07464572220811108, scale: 282.125 }
			]
		});
		let layer = new WebTileLayer({
			id: 'basemap1',
			urlTemplate:
				layerUrl+'?service=wmts&request=GetTile&layer='+'4c9fd962349f43d3b7036410495ecef6'+'&style=default&TileMatrixSet=default028mm&TileMatrix={level}&TileRow={row}&TileCol={col}&format=image/png&mapuserid=1',
			spatialReference: spatialReference,
			fullExtent: {
				xmin: 528134.2439974264,
				ymin: 2479133.132957764,
				xmax: 848266.928417676,
				ymax: 2634523.9978181086,
				spatialReference: spatialReference
			},
			tileInfo: tileInfo,
			opacity:1,
			});
		
		require(["esri/Map","esri/views/MapView"], function(Map, MapView) {
			var map = new Map({
				layers:	[layer],
				logo: false
			});
			// 在页面中呈现地图
			var view = new MapView({
			container: "mapViewDiv", // html dom元素id，用来作为地图视图容器
			map: map,// 地图对象
			zoom:9,
			spatialReference: spatialReference
			});
			view.ui.components = [];
		});
	});

</script>
</body>
</html>